<html>
<head><meta charset="utf-8"><title>PredicateKind::Atom removal · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html">PredicateKind::Atom removal</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="220764547"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/220764547" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#220764547">(Dec 23 2020 at 06:28)</a>:</h4>
<p>So, I started on the refactoring to remove <code>PredicateKind::Atom</code> and just <code>PredicateKind</code> in general, in favor of just <code>Binder&lt;PredicateAtom&lt;'tcx&gt;&gt;</code></p>



<a name="220764551"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/220764551" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#220764551">(Dec 23 2020 at 06:29)</a>:</h4>
<p>See branch <a href="https://github.com/jackh726/rust/compare/predicate-kind">here</a></p>



<a name="220764553"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/220764553" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#220764553">(Dec 23 2020 at 06:29)</a>:</h4>
<p>Problem is, I'm at a point that I'm stuck</p>



<a name="220764605"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/220764605" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#220764605">(Dec 23 2020 at 06:30)</a>:</h4>
<p>I was able to successfully just remove <code>PredicateKind::Atom</code> and leave only <code>PredicateKind::ForAll</code></p>



<a name="220764612"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/220764612" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#220764612">(Dec 23 2020 at 06:30)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/commit/c7f1cf6c1c37c89b60f985571d638c1afc2ba996">this commit</a></p>



<a name="220764627"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/220764627" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#220764627">(Dec 23 2020 at 06:30)</a>:</h4>
<p>But then, I tried to remove <code>PredicateKind</code> completely and just use <code>Binder&lt;PredicateAtom&lt;'tcx&gt;&gt;</code> <a href="https://github.com/rust-lang/rust/commit/d2d3dd8f873a1505110245edfa7b523cd9192538">here</a> and everything blows up</p>



<a name="220764628"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/220764628" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#220764628">(Dec 23 2020 at 06:31)</a>:</h4>
<p>Can't even compile core</p>



<a name="220764648"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/220764648" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#220764648">(Dec 23 2020 at 06:31)</a>:</h4>
<p>for reference I get the following error, though I don't think this in particular matters:</p>
<div class="codehilite"><pre><span></span><code>error[E0369]: cannot subtract `{integer}` from `{integer}`
   --&gt; library/core/src/array/mod.rs:393:33
</code></pre></div>



<a name="220764718"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/220764718" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#220764718">(Dec 23 2020 at 06:33)</a>:</h4>
<p>Honestly, not really sure what went wrong. The diff is pretty minimal. Was mostly hoping that a couple people could take a look and see if they spot anything obvious that I missed</p>



<a name="220765391"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/220765391" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#220765391">(Dec 23 2020 at 06:52)</a>:</h4>
<p>Oh, well it's the Encodable change...of course it is<br>
Edit: nevermind</p>



<a name="220770877"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/220770877" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#220770877">(Dec 23 2020 at 08:51)</a>:</h4>
<p>type flags maybe?</p>



<a name="220771044"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/220771044" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#220771044">(Dec 23 2020 at 08:54)</a>:</h4>
<p>though I can't see why that would be incorrect</p>



<a name="220771434"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/220771434" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#220771434">(Dec 23 2020 at 09:01)</a>:</h4>
<p>hmm, can't see anything wrong myself in your last commit <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="220771447"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/220771447" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#220771447">(Dec 23 2020 at 09:01)</a>:</h4>
<p>shouldn't really change the behavior anywhere</p>



<a name="220799730"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/220799730" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#220799730">(Dec 23 2020 at 15:46)</a>:</h4>
<p>Bleh that's what I was afraid of</p>



<a name="220805661"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/220805661" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#220805661">(Dec 23 2020 at 16:52)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/compare/master...jackh726:predicate-kind#diff-2f72dd1963ca7043f3c7cec775db8101be5b20975ab64a563dababa7c4abd06eR120">https://github.com/rust-lang/rust/compare/master...jackh726:predicate-kind#diff-2f72dd1963ca7043f3c7cec775db8101be5b20975ab64a563dababa7c4abd06eR120</a></p>



<a name="220805670"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/220805670" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#220805670">(Dec 23 2020 at 16:52)</a>:</h4>
<p>That's it, isn't it.</p>



<a name="220805681"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/220805681" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#220805681">(Dec 23 2020 at 16:52)</a>:</h4>
<p>A <code>==</code> that should be  <code>!=</code></p>



<a name="220805697"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/220805697" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#220805697">(Dec 23 2020 at 16:53)</a>:</h4>
<p>ugh probably not because it's a clippy lint<br>
Edit: nope, not it</p>



<a name="221102485"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/221102485" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#221102485">(Dec 29 2020 at 00:36)</a>:</h4>
<p>So yeah, I tried to take this much more piecemeal and figure out exactly what's the problem. And honestly, I have no clue. I got it down to where the <em>only</em> change is changing from <code>PredicateKind::ForAll</code> to <code>Binder&lt;PredicateAtom&gt;</code> and that fails. Like, a "minimal" repro is just changing the <code>kind</code> in <code>PredicateInner</code> to <code>Binder&lt;PredicateAtom&gt;</code>. So idk.</p>
<p>If anyone has so time and/or curiosity and wants to try to help me figure this out, I would really appreciate it. This seems like a simple refactoring and there's something subtle happening.</p>



<a name="221427255"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/221427255" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#221427255">(Jan 03 2021 at 01:31)</a>:</h4>
<p>Trying to look into this a bit more</p>



<a name="221427309"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/221427309" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#221427309">(Jan 03 2021 at 01:32)</a>:</h4>
<p>Since the problem is occurring during build of core, I figured I would try to create a min repro with <code>#![no_core]</code> that I can just build with rustc (and then dig into logs and compare)</p>



<a name="221427314"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/221427314" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#221427314">(Jan 03 2021 at 01:32)</a>:</h4>
<p>So, I came up with</p>
<div class="codehilite"><pre><span></span><code>#![no_main]
#![feature(lang_items)]
#![feature(no_core)]
#![feature(rustc_attrs)]
#![feature(fundamental)]
#![feature(specialization)]

#[lang = &quot;sized&quot;]
#[fundamental]
#[rustc_specialization_trait]
trait Sized {}

trait Default: Sized {
    fn default() -&gt; Self;
}

macro_rules! array_impl_default {
    {$n:expr, $t:ident $($ts:ident)*} =&gt; {
        impl&lt;T&gt; Default for [T; $n] where T: Default {
            fn default() -&gt; [T; $n] {
                [$t::default(), $($ts::default()),*]
            }
        }
        array_impl_default!{($n - 1), $($ts)*}
    };
    {$n:expr,} =&gt; {
        impl&lt;T&gt; Default for [T; $n] {
            fn default() -&gt; [T; $n] { [] }
        }
    };
}

//array_impl_default! {32, T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T}
array_impl_default! {1, T}
</code></pre></div>



<a name="221427335"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/221427335" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#221427335">(Jan 03 2021 at 01:33)</a>:</h4>
<p>But, on nightly, I get the same "cannot subtract <code>{integer}</code> from <code>{integer}</code>" error that I see on my branch</p>



<a name="221427395"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/221427395" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#221427395">(Jan 03 2021 at 01:34)</a>:</h4>
<p>Obviously, it compiles in the broader context of core on nightly</p>



<a name="221427400"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/221427400" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#221427400">(Jan 03 2021 at 01:34)</a>:</h4>
<p>but it's a bit interesting that trying to isolate it gives the same error</p>



<a name="221427912"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/221427912" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#221427912">(Jan 03 2021 at 01:49)</a>:</h4>
<p>So, idk if it's just me, but this seems like it should compile: <a href="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=4c3838ef629cb6b522c6c1f99d4786b9">https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=4c3838ef629cb6b522c6c1f99d4786b9</a></p>



<a name="221444684"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/221444684" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#221444684">(Jan 03 2021 at 10:30)</a>:</h4>
<p>don't you need the to add the sub impls for integers for this to work?</p>



<a name="221444689"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/221444689" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#221444689">(Jan 03 2021 at 10:30)</a>:</h4>
<p>even if they are intrinsic we still have to manually add them as noops for the trait system to consider them</p>



<a name="221460772"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/221460772" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#221460772">(Jan 03 2021 at 17:12)</a>:</h4>
<p>Oh, probably</p>



<a name="221485396"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/221485396" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#221485396">(Jan 04 2021 at 03:10)</a>:</h4>
<p>Okay <a href="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=2ff3ed805ac5023e63a9584ab1bb5cdf">this</a> checks successfully</p>



<a name="221487518"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/221487518" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#221487518">(Jan 04 2021 at 04:03)</a>:</h4>
<p>Alright so that definitely is a minimized (maybe there's more I can do, but it's a good start) repo</p>



<a name="221487565"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/221487565" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#221487565">(Jan 04 2021 at 04:04)</a>:</h4>
<p>there's actually many errors</p>



<a name="221487568"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/221487568" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#221487568">(Jan 04 2021 at 04:04)</a>:</h4>
<p>e.g.: "cannot subtract <code>usize</code> from <code>usize</code>"</p>



<a name="221490450"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/221490450" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#221490450">(Jan 04 2021 at 05:22)</a>:</h4>
<p>Edit: changing <code>0</code> to <code>(1 - 1)</code> gives the "expected" error</p>



<a name="221490476"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/221490476" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#221490476">(Jan 04 2021 at 05:23)</a>:</h4>
<p>Seems like potentially a problem in canonicalization</p>



<a name="221490485"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/221490485" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#221490485">(Jan 04 2021 at 05:23)</a>:</h4>
<p>Before:</p>
<div class="codehilite"><pre><span></span><code>├─0ms DEBUG rustc_middle::ty::fold HasTypeFlagsVisitor: predicate=ForAll(Binder(TraitPredicate(&lt;{integer} as Sub&lt;_&gt;&gt;))) predicate.flags=HAS_TY_INFER | STILL_FURTHER_SPECIALIZABLE self.flags=HAS_TY_INFER | HAS_RE_INFER | HAS_CT_INFER | NEEDS_INFER | HAS_TY_PLACEHOLDER | HAS_CT_PLACEHOLDER | HAS_FREE_REGIONS
├─0ms DEBUG rustc_infer::infer::canonical::canonicalizer canonical: type var found with vid _#1t
├─0ms DEBUG rustc_middle::ty::fold HasTypeFlagsVisitor: predicate=ForAll(Binder(TraitPredicate(&lt;^1_0 as Sub&lt;^1_1&gt;&gt;))) predicate.flags=(empty) self.flags=HAS_TY_INFER | HAS_RE_INFER | HAS_CT_INFER | NEEDS_INFER
├─0ms DEBUG rustc_query_system::query::plumbing ty::query::get_query&lt;evaluate_obligation&gt;(key=Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(Int) }, CanonicalVarInfo { kind: Ty(General(U0)) }], value: ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: UserFacing }, value: ForAll(Binder(TraitPredicate(&lt;^1_0 as Sub&lt;^1_1&gt;&gt;))) } }, span=target/min3.rs:1:1: 1:1 (#0))
</code></pre></div>
<p>After:</p>
<div class="codehilite"><pre><span></span><code>├─0ms DEBUG rustc_middle::ty::fold HasTypeFlagsVisitor: predicate=Binder(TraitPredicate(&lt;{integer} as Sub&lt;_&gt;&gt;)) predicate.flags=HAS_TY_INFER | STILL_FURTHER_SPECIALIZABLE self.flags=HAS_TY_INFER | HAS_RE_INFER | HAS_CT_INFER | NEEDS_INFER | HAS_TY_PLACEHOLDER | HAS_CT_PLACEHOLDER | HAS_FREE_REGIONS
├─0ms DEBUG rustc_infer::infer::canonical::canonicalizer canonical: type var found with vid _#1t
├─0ms DEBUG rustc_middle::ty::fold HasTypeFlagsVisitor: predicate=Binder(TraitPredicate(&lt;^0 as Sub&lt;^1&gt;&gt;)) predicate.flags=(empty) self.flags=HAS_TY_INFER | HAS_RE_INFER | HAS_CT_INFER | NEEDS_INFER
├─0ms DEBUG rustc_query_system::query::plumbing ty::query::get_query&lt;evaluate_obligation&gt;(key=Canonical { max_universe: U0, variables: [CanonicalVarInfo { kind: Ty(Int) }, CanonicalVarInfo { kind: Ty(General(U0)) }], value: ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: UserFacing }, value: Binder(TraitPredicate(&lt;^0 as Sub&lt;^1&gt;&gt;)) } }, span=target/min3.rs:1:1: 1:1 (#0))
</code></pre></div>



<a name="221490893"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/221490893" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#221490893">(Jan 04 2021 at 05:34)</a>:</h4>
<p>I wonder if somehow the <code>Binder</code> is getting skipped during folding</p>



<a name="221490901"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/221490901" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#221490901">(Jan 04 2021 at 05:34)</a>:</h4>
<p>Maybe something related to the <code>Borrow</code> impls around <code>Predicate</code> types</p>



<a name="221491381"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/221491381" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#221491381">(Jan 04 2021 at 05:48)</a>:</h4>
<p>Okay...so think I found the problem</p>



<a name="221491427"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/221491427" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#221491427">(Jan 04 2021 at 05:48)</a>:</h4>
<p>(still speculation since I haven't tested)</p>



<a name="221491432"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/221491432" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#221491432">(Jan 04 2021 at 05:48)</a>:</h4>
<p>But I think it comes down to the <code>TypeFoldable</code> impl for <code>Predicate</code></p>



<a name="221491439"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/221491439" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#221491439">(Jan 04 2021 at 05:48)</a>:</h4>
<p>in that it impls <code>super_fold_with</code> but not <code>fold_with</code></p>



<a name="221491453"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/221491453" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#221491453">(Jan 04 2021 at 05:49)</a>:</h4>
<p>Or, I guess, that the <code>super_fold_with</code> impl calls <code>inner.kind.super_fold_with</code> instead of <code>inner.kind.fold_with</code></p>



<a name="221491512"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/221491512" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#221491512">(Jan 04 2021 at 05:50)</a>:</h4>
<p>On <code>Binder</code>, the former does <em>not</em> call <code>fold_binder</code>, the latter does</p>



<a name="221491522"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/221491522" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#221491522">(Jan 04 2021 at 05:50)</a>:</h4>
<p>So, the binder index never gets incremented :/</p>



<a name="221491925"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/221491925" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#221491925">(Jan 04 2021 at 06:02)</a>:</h4>
<p>Well, that does seems to be the issue</p>



<a name="221491962"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/221491962" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#221491962">(Jan 04 2021 at 06:02)</a>:</h4>
<p>/me mumbles under his breath that he just jinxed it</p>



<a name="221492266"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/221492266" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#221492266">(Jan 04 2021 at 06:10)</a>:</h4>
<p>That did it</p>



<a name="221492268"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/221492268" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#221492268">(Jan 04 2021 at 06:10)</a>:</h4>
<p>Okay then</p>



<a name="221494445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/PredicateKind%3A%3AAtom%20removal/near/221494445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/PredicateKind.3A.3AAtom.20removal.html#221494445">(Jan 04 2021 at 07:03)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/issues/80679">#80679</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>